<div class="modal-debug-terminal">
  <div class="modal-header">
    <h2>Debug Container {{container.name}}</h2>
    <small class="text-muted">
      {{debugPod.metadata.name}} &mdash;
      <status-icon status="debugPod | podStatus"></status-icon>
      {{debugPod | podStatus | sentenceCase}}
    </small>
  </div>
  <div class="modal-body">
    <div ng-if="!containerState.running" class="empty-state-message text-center">
      <!-- Waiting for debug container to start. -->
      <h2 ng-if="debugPod.status.phase !== 'Failed'" class="text-muted">
        Waiting for container {{container.name}} to start...
      </h2>
      <!-- Debug container failed. -->
      <div ng-if="debugPod.status.phase === 'Failed'">
        <h2>
          <span class="pficon pficon-error-circle-o" aria-hidden="true"></span>
          Could not start container {{container.name}}.
        </h2>
        <p>
          An error occurred starting the debug pod.
          <span ng-if="containerState.terminated.message">{{containerState.terminated.message}}</span>
          <span ng-if="containerState.terminated.exitCode" class="text-muted">Exit code: {{containerState.terminated.exitCode}}</span>
        </p>
      </div>
    </div>
    <!-- Debug container running. -->
    <div ng-if="containerState.running">
      <div class="help-block">
        This temporary pod has a modified entrypoint command to debug a failing container. The pod
        will be available for one hour and will be deleted when the terminal window is closed.
      </div>
      <div ng-if="container | entrypoint : image" class="original-cmd-msg">
        <label>Original Command:</label>
        <code>
          <truncate-long-text
              content="container | entrypoint : image"
              limit="80"
              newline-limit="1"
              expandable="false"
              use-word-boundary="false">
          </truncate-long-text>
        </code>
        <!-- Don't add the copy-to-clipboard button for now since we have problems with paste in the terminal. -->
        <!-- <copy-to-clipboard clipboard-text="container | entrypoint : image"></copy-to-clipboard> -->
      </div>
      <kubernetes-container-terminal pod="debugPod" container="container.name"></kubernetes-container-terminal>
    </div>
  </div>
  <div class="modal-footer">
    <button class="btn btn-lg btn-primary" type="button" ng-click="close()">Close</button>
  </div>
</div>
